package com.server.mapper;

import com.server.entity.UpmsRole;
import com.server.entity.UpmsUserRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 用户角色关联表 Mapper 接口
 * </p>
 *
 * @author
 * @since 2020-04-03
 */
public interface UpmsUserRoleMapper extends BaseMapper<UpmsUserRole> {

    @Select("SELECT r.* FROM upms_user_role ur left join upms_role r on ur.role_id=r.role_id " +
            "where ur.user_id=#{userId}   ")
    List<UpmsRole> findByUserId(@Param("userId") Integer userId);
}
